def isPrime(num):
    for i in range(2, num // 2 + 1):
        if num % i == 0:
            return False
    return True

count = 0
num = 2
while True:
    if isPrime(num) and isPrime(num + 2):
        print("(%d,%d)" % (num, num + 2), end=" ")
        count += 1
        if count % 10 == 0:
            print()
    num += 1
    if num >= 1000:
        break
